import { reactive, ref } from "vue";

export default function InitHook() {
  const searchForm = reactive<WaybillCustomerBalance.SearchForm>({
    companyIdList: [],
    shortNameList: [],
    bizIdList: [],
    finIdList: [],
    accountPeriodIdList: [],
    beforePageNum: 0,
    pageNum: 1,
    pageSize: 100,
    total: 0
  });
  const tableRef = ref<any>(null);
  const asyncTable = ref<boolean>(false);
  const tableColumn = ref<Array<SuperTable.TableCoulmnItem | SuperTable.NestTableColumnItem>>([]);

  const tableData = ref<Array<BusinessWaybill.ListRows>>([]);

  const drawerOpts = reactive<Base.DrawerOpts>({
    title: "",
    width: "520px",
    component: "",
    visible: false,
    type: 1,
    passData: {}
  });

  return {
    tableRef,
    searchForm,
    tableData,
    drawerOpts,
    tableColumn,
    asyncTable
  };
}
